package com.sky.service.impl;

import com.sky.constant.StatusConstant;
import com.sky.entity.Setmeal;
import com.sky.result.Result;
import com.sky.service.ShopService;
import com.sky.vo.DishItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import javax.swing.*;
import java.util.List;

/**
 * @Auther: zhaoss
 * @Date: 2023/5/3 - 05 - 03 - 20:17
 * @Description: com.sky.service.impl
 * @version: 1.0
 */
@Service
public class ShopServiceImpl implements ShopService {
    public static final String KEY = "SHOP_STATUS";
    @Autowired
    private StringRedisTemplate stringRedisTemplate;
    /**
     * 修改状态
     *
     * @param status
     * @return
     */
    @Override
    public Result putShop(Integer status) {

        stringRedisTemplate.opsForValue().set(KEY,status+"");
        return Result.success();
    }

    /**
     * 查询店铺状态
     *
     * @return
     */
    @Override
    public Result getStatus() {
        Integer s = Integer.valueOf(stringRedisTemplate.opsForValue().get(KEY));
        return Result.success(s);
    }


}
